import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { HttpClient } from '@angular/common/http';


@Injectable({
    providedIn: 'root'
})
export class MessageboardService {

    private resourceUrl = 'api/messageboard';

    constructor(private http: HttpClient) {}

    getAllMessage():Observable<any>{
        return this.http.get<any>(this.resourceUrl);
    }
    addMessage(json:any):Observable<any>{
        return this.http.post<any>(this.resourceUrl,json);
    }
    

}